package org.myboot.MyPrint.starter;

import org.MySpringBoot.Annotations.Component;
import org.MySpringBoot.Annotations.EnableConfigurationProperties;

@Component
@EnableConfigurationProperties(MyPrinterProperties.class)
public class MyPrinter {

    private final MyPrinterProperties properties;
    private static final String RESET = "\u001B[0m";

    public MyPrinter(MyPrinterProperties properties) {
        this.properties = properties;
    }

    public void print(String content) {
        String useBg = properties.getUseBackground();
        String useFont = properties.getUseFontColor();
        System.out.println(useBg + useFont + content + RESET);
    }
}